﻿using App.Common;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CardObject : MonoBehaviour
{
    //六边形
    public List<hexagon> hexagons;

    [HideInInspector]
    public Card _bindCard;

    //类型
    public Data.ChangeType changeType;

    private void Start()
    {
        hexagons = new List<hexagon>();
        for (int i = 0; i < transform.childCount; i++)
        {
            hexagons.Add(transform.GetChild(i).GetComponent<hexagon>());
            hexagons[i].transform.localPosition = Data.Instance.getWorldPos(hexagons[i].Pos);
        }
    }

    /// <summary>
    /// 重置六边形的位置
    /// </summary>
    protected void SetPos()
    {
        for (int i = 0; i < this.transform.childCount; i++)
        {
            hexagon child = this.transform.GetChild(i).GetComponent<hexagon>();
            //Debug.Log(child.gameObject.name);
            child.transform.position = Data.Instance.getWorldPos(child.Pos);
            //Debug.Log(getWorldPos(child.Pos).ToString());
        }
    }

    public virtual void DynasticChangeSlots()
    {

    }
}
